package com.drxx.controller;

import com.drxx.bean.UserInfo;
import com.drxx.service.IUserInfoService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author wangzg
 */
@Controller
@RequestMapping(value = "/userinfo")
public class UserInfoCotroller {

    private Logger logger = Logger.getLogger(UserInfoCotroller.class);
    @Autowired
    private IUserInfoService userInfoService;

    @RequestMapping(value = "/findById")
    public UserInfo findById(int id){
        logger.info("...in UserInfoCotroller findById...");
        return  userInfoService.findById(id);
    }

    @RequestMapping(value = "/insert")
    public int insert(List<UserInfo> userInfoList){
        logger.info("...in UserInfoCotroller insert...");
        return userInfoService.insert(userInfoList);
    }
}
